package com.atguigu.classroom.order.controller;


import com.atguigu.classroom.model.order.OrderInfo;
import com.atguigu.classroom.order.service.OrderInfoService;
import com.atguigu.classroom.result.Result;
import com.atguigu.classroom.vo.order.OrderInfoQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 订单表 订单表 前端控制器
 * </p>
 */
@Api(tags = "订单管理")
@RestController
@RequestMapping("/admin/order/orderInfo/")
public class OrderInfoController {
    @Autowired
    private OrderInfoService orderInfoService;
    @ApiOperation("分页查询订单列表")
    @GetMapping("{page}/{limit}")
    public Result listOrder(@PathVariable int page,
                            @PathVariable int limit,
                            OrderInfoQueryVo orderInfoQueryVo){
        Page<OrderInfo> orderInfoPage=orderInfoService.getPage(page,limit,orderInfoQueryVo);
        return Result.ok(orderInfoPage);
    }
}

